'''
Created on 15/03/2012

@author: nicolas
'''

import pylab as p
from matplotlib.pyplot import plot

N = 200
K = 50

resultado = []

for n in range(N + 1):
    sumatoria = 0
    for k in range(K + 1):  
        f_k = 100 * p.tan(3 * k * p.pi / 400)
        sumatoria += p.cos(p.pi * f_k * n / 2)
        
    resultado.append(sumatoria)


plot(resultado)
p.savefig('ej11_g_n'+str(N)+'_k'+str(K)+'.png')
p.show()
